<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Binh
 * Date: 12/17/13
 * Time: 1:11 PM
 * To change this template use File | Settings | File Templates.
 */

use \Model\Song;
class Controller_Hello extends Controller{
    private $view;
    public function __construct(){
        $this->view = View::forge('hello');
    }

    public function action_index(){
        $ids = \Model\Song::get_all();
        if(!$ids){
            return "SO1";
        }
        else{
            $number = array();
            foreach($ids as $id){
                $id = $id['SONG_ID'];
                $number[] =  substr($id, 2, strlen($id));
            }

            sort($number);

            $result = $number[count($number) - 1] + 1;

            return "SO".$result;
        }

    }


}